/*
 * FunnelNode.h
 *
 *  Created on: 16/08/2012
 *      Author: Aeradon
 */

#ifndef FUNNELNODE_H_
#define FUNNELNODE_H_

#include <stdlib.h>

#include "point.hpp"
#include "PFRUtils.hpp"

//a node in the funnel deque
class FunnelNode
{
private:
	typedef float	T;
protected:
	//left and right pointers (doubly-connected)
	FunnelNode *pLeft;
	FunnelNode *pRight;
	//the vertex represented by this funnel node
	Point<T> position;

public:
	//default constructor
	FunnelNode();
	//constructor - initializes the vertex coordinates
	FunnelNode(float x, float y);
	//constructor - initializes the vertex
	FunnelNode(const Point<T>& point);
	//mutator for the left pointer
	void Left(FunnelNode *left);
	//mutator for the right pointer
	void Right(FunnelNode *right);
	//accessor for the left pointer
	FunnelNode *Left();
	//accessor for the right pointer
	FunnelNode *Right();
	//mutator for the vertex
	void SetPoint(const Point<T>& point);
	//accessor for the vertex
	Point<T> GetPoint();
	//mutator for the vertex coordinates
	void SetPoint(float x, float y);
	//accessor for the vertex x coordinate
	float X();
	//accessor for the vertex y coordinate
	float Y();
};

#endif /* FUNNELNODE_H_ */
